From 06bad0ec523d4c3ce953c00f93eccb1e9553ae63 Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Wed, 5 Aug 2026 14:59:43 +0000 Subject: [PATCH] Add example query to FOOD_EVENTS doc --- doc/src/tables/food_events.m4 | 37 +++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/doc/src/tables/food_events.m4 b/doc/src/tables/food_events.m4 index 63bfcb5..c2db2a0 100644 --- a/doc/src/tables/food_events.m4 +++ b/doc/src/tables/food_events.m4 @@ -34,10 +34,6 @@ FOOD_EVENTS |FOOD_EVENTS_summary| -.. sidebar:: - - |OBS helpful| - .. sidebar:: The conversion of transcribed food-related text The MS Access database recorded |FOOD_EVENTS.FoodPartWritten| and @@ -74,6 +70,39 @@ For further information, including additional data integrity rules, see the documentation of the :ref:`EVENTS ` table. +The |OBS| view is useful when querying FOOD_EVENTS. + +.. code-block:: sql + :caption: + Using OBS and ROLES to provide a more complete picture of food bouts + + SELECT obs.wid, obs.type + , obs.eid + , roles.pid + , food_events.feid + , obs.date + , obs.animid AS focal + , roles.participant AS animid + , obs.commid + , obs.start + , obs.stop + , obs.certainty + , food_events.seq + , food_events.foodpart + , food_events.foodname + , food_events.foodpartwritten + , food_events.foodnamewritten + , obs.notes + , obs.event_notes + FROM obs + JOIN food_events + ON (food_events.eid = obs.eid) + JOIN roles + ON (roles.eid = obs.eid) + WHERE obs.behavior = 'sdb_food' + ORDER BY roles.participant, obs.date, obs.start, obs.stop + , food_events.seq, food_events.feid; + .. contents:: :depth: 2 -- 2.34.1